package com.test.controller;

import com.test.pojo.OrderDetail;
import com.test.service.OrderDetailService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class OrderDetailCtrl {
    @Resource
    private OrderDetailService orderDetailService;
    //获取订单页面查询
    @RequestMapping(value = "/getAllOrderDetail")
    public String getAllOrderDetail(Model model){
        List<OrderDetail> orderDetail = orderDetailService.getAllOrderDetail();
        model.addAttribute("orderDetail",orderDetail);
        return "OrderDetail";
    }
}
